<template>
    <div class="tab-bar">
        <ul>
          <li
            v-for="nav in navs"
            :key="nav.path"
            is='router-link'
            tag='li'
            :to='nav.path'
          >
            <i class="iconfont" v-html="nav.meta.icon"></i>
            <span>{{nav.meta.title}}</span>
          </li>
        </ul>
    </div>
</template>

<script>
import routes from '@/router/routes'
export default {
  name: 'TabBar',
  computed: {
    navs() {
      return routes.filter(route => route.meta?.inTabBar)
    },
  },
}
</script>

<style lang="less" scoped>
@font-face {
  font-family: 'iconfont';  /* Project id 2640737 */
  src: url('//at.alicdn.com/t/font_2640737_99w0iwsvlto.woff2?t=1624955991296') format('woff2'),
       url('//at.alicdn.com/t/font_2640737_99w0iwsvlto.woff?t=1624955991296') format('woff'),
       url('//at.alicdn.com/t/font_2640737_99w0iwsvlto.ttf?t=1624955991296') format('truetype');
}
.iconfont{
    font-family:"iconfont" !important;
    font-size:16px;font-style:normal;
    -webkit-font-smoothing: antialiased;
    -webkit-text-stroke-width: 0.2px;
    -moz-osx-font-smoothing: grayscale;}
.tab-bar{
  width:100%;
  margin: 12px auto;
  ul{
    display: flex;
    justify-content: space-evenly;
    li{
      display: flex;
      flex-direction: column;
      align-items: center;
      i{
        font-size: 25px;
        margin-bottom: 5px;
      }
      span{
        font-size: 14px;
      }
    }
    .router-link-exact-active,.router-link-active{
      color:#ff5f16;
    }
  }
}
</style>
